package net.yambal.air.LeafletMap.OverLays
{
	import net.yambal.air.LeafletMap.ILeafletOverlay;
	import net.yambal.air.LeafletMap.LatLng;
	import net.yambal.air.LeafletMap.LeafletCoreSinglton;

	public class Marker implements ILeafletOverlay{

		private var _leafTyileMarker:Object;
		
		public function Marker(latlng:LatLng, icon:LIcon = null){
            if(!icon){
			    var icon:LIcon = new LIcon(LImage.MARKER_ICON, 25, 41, 12, 41, 2, -35,LImage.MARKER_ICON_SHADOW, 41, 41, 12, 41);
            }
            this._leafTyileMarker = LeafletCoreSinglton.instance.marker(latlng.LeafObject, {icon:icon.LeafObject});
		}
		
		public function get LeafObject():Object{
			return this._leafTyileMarker;
		}
        
        public function bindPopup(s:String):ILeafletOverlay{
            this._leafTyileMarker.bindPopup(s);
            return this;
        }
        
        public function openPopup():ILeafletOverlay{
            this._leafTyileMarker.openPopup();
            return this;
        }
	}
}